home *** CD-ROM | disk | FTP | other *** search
/ Windows Expert / Windows Expert.iso / windownt / perlnt.zip / t / lib / abbrev.nt next >
Text File  |  1993-07-25  |  576b  |  27 lines

  1. require 'abbrev.pl';
  2.  
  3. print "1..2\n";
  4.  
  5. %abdul = ();
  6.  
  7. &abbrev (*abdul, 'he', 'help', 'hi', 'bye', 'wally', 'world');
  8.  
  9. @good = ('b', 'by', 'bye', 'he', 'hel', 'help', 'hi', 'wa',
  10.      'wa', 'wal', 'wall', 'wally', 'wo', 'wor', 'worl',
  11.      'world');
  12.  
  13. @bad = ('barf', 'bad', 'byef', 'hell', 'wallo', 'waldo', 'will');
  14.  
  15. $ok = 1;
  16. foreach (@good) {
  17.     $ok = 0 if !defined($abdul{$_});
  18. }
  19. if ($ok) {print "ok 1\n";} else {print "not ok 1\n";}
  20.  
  21. $ok = 1;
  22. foreach (@bad) {
  23.     $ok = 0 if defined($abdul{$_});
  24. }
  25. if ($ok) {print "ok 2\n";} else {print "not ok 2\n";}
  26.  
  27.